package com.packenius.library.xspdf;

import java.util.HashMap;
import java.util.Map;

/**
 * Alternative font encoding.
 * 
 * @author Christian Packenius, 2013.
 */
class XST1AltFontEncoding2 extends XSAlternativeFontEncoding {
  /**
   * Maps an Utf-8 (Unicode?) code (0..65535) to the byte in this font encoding.
   */
  static final Map<Character, Character> altFontEncoding2 = new HashMap<Character, Character>();

  private static final String altFontEnc2Diffs = "127 /plusminus /brokenbar /registered /Gbreve /Idotaccent /summation /Egrave /racute /omacron /Zacute /Zcaron /greaterequal /Eth /Ccedilla /lcommaaccent /tcaron /eogonek /Uogonek /Aacute /Adieresis /egrave /zacute /iogonek /Oacute /oacute /amacron /sacute /idieresis /Ocircumflex /Ugrave /Delta /thorn /twosuperior /Odieresis 176 /mu 181 /igrave 190 /ohungarumlaut 192 /Eogonek 201 /dcroat 204 /threequarters 209 /Scedilla /lcaron /Kcommaaccent /Lacute /trademark /edotaccent /Igrave /Imacron /Lcaron /onehalf /lessequal /ocircumflex /ntilde /Uhungarumlaut /Eacute /emacron 226 /gbreve 228 /onequarter /Scaron /Scommaaccent /Ohungarumlaut 236 /degree /ograve /Ccaron /ugrave /radical 242 /Dcaron /rcommaaccent /Ntilde 246 /otilde /Rcommaaccent";

  static {
    altFontEncoding2.put('\u00b1', (char) 127);
    altFontEncoding2.put('\u00a6', (char) 128);
    altFontEncoding2.put('\u00ae', (char) 129);
    altFontEncoding2.put('\u011e', (char) 130);
    altFontEncoding2.put('\u0130', (char) 131);
    altFontEncoding2.put('\u2211', (char) 132);
    altFontEncoding2.put('\u00c8', (char) 133);
    altFontEncoding2.put('\u0155', (char) 134);
    altFontEncoding2.put('\u014d', (char) 135);
    altFontEncoding2.put('\u0179', (char) 136);
    altFontEncoding2.put('\u017d', (char) 137);
    altFontEncoding2.put('\u2265', (char) 138);
    altFontEncoding2.put('\u00d0', (char) 139);
    altFontEncoding2.put('\u00c7', (char) 140);
    altFontEncoding2.put('\u013c', (char) 141);
    altFontEncoding2.put('\u0165', (char) 142);
    altFontEncoding2.put('\u0119', (char) 143);
    altFontEncoding2.put('\u0172', (char) 144);
    altFontEncoding2.put('\u00c1', (char) 145);
    altFontEncoding2.put('\u00c4', (char) 146);
    altFontEncoding2.put('\u00e8', (char) 147);
    altFontEncoding2.put('\u017a', (char) 148);
    altFontEncoding2.put('\u012f', (char) 149);
    altFontEncoding2.put('\u00d3', (char) 150);
    altFontEncoding2.put('\u00f3', (char) 151);
    altFontEncoding2.put('\u0101', (char) 152);
    altFontEncoding2.put('\u015b', (char) 153);
    altFontEncoding2.put('\u00ef', (char) 154);
    altFontEncoding2.put('\u00d4', (char) 155);
    altFontEncoding2.put('\u00d9', (char) 156);
    altFontEncoding2.put('\u2206', (char) 157);
    altFontEncoding2.put('\u00fe', (char) 158);
    altFontEncoding2.put('\u00b2', (char) 159);
    altFontEncoding2.put('\u00d6', (char) 160);
    altFontEncoding2.put('\u00b5', (char) 176);
    altFontEncoding2.put('\u00ec', (char) 181);
    altFontEncoding2.put('\u0151', (char) 190);
    altFontEncoding2.put('\u0118', (char) 192);
    altFontEncoding2.put('\u0111', (char) 201);
    altFontEncoding2.put('\u00be', (char) 204);
    altFontEncoding2.put('\u015e', (char) 209);
    altFontEncoding2.put('\u013e', (char) 210);
    altFontEncoding2.put('\u0136', (char) 211);
    altFontEncoding2.put('\u0139', (char) 212);
    altFontEncoding2.put('\u2122', (char) 213);
    altFontEncoding2.put('\u0117', (char) 214);
    altFontEncoding2.put('\u00cc', (char) 215);
    altFontEncoding2.put('\u012a', (char) 216);
    altFontEncoding2.put('\u013d', (char) 217);
    altFontEncoding2.put('\u00bd', (char) 218);
    altFontEncoding2.put('\u2264', (char) 219);
    altFontEncoding2.put('\u00f4', (char) 220);
    altFontEncoding2.put('\u00f1', (char) 221);
    altFontEncoding2.put('\u0170', (char) 222);
    altFontEncoding2.put('\u00c9', (char) 223);
    altFontEncoding2.put('\u0113', (char) 224);
    altFontEncoding2.put('\u011f', (char) 226);
    altFontEncoding2.put('\u00bc', (char) 228);
    altFontEncoding2.put('\u0160', (char) 229);
    altFontEncoding2.put('\u0218', (char) 230);
    altFontEncoding2.put('\u0150', (char) 231);
    altFontEncoding2.put('\u00b0', (char) 236);
    altFontEncoding2.put('\u00f2', (char) 237);
    altFontEncoding2.put('\u010c', (char) 238);
    altFontEncoding2.put('\u00f9', (char) 239);
    altFontEncoding2.put('\u221a', (char) 240);
    altFontEncoding2.put('\u010e', (char) 242);
    altFontEncoding2.put('\u0157', (char) 243);
    altFontEncoding2.put('\u00d1', (char) 244);
    altFontEncoding2.put('\u00f5', (char) 246);
    altFontEncoding2.put('\u0156', (char) 247);
  }

  /**
   * @see com.packenius.library.xspdf.XSAlternativeFontEncoding#getPdfDifferencesListContent()
   */
  @Override
  public String getPdfDifferencesListContent() {
    return altFontEnc2Diffs;
  }

  /**
   * @see com.packenius.library.xspdf.XSAlternativeFontEncoding#getID()
   */
  @Override
  public String getID() {
    return "2";
  }

  /**
   * @see com.packenius.library.xspdf.XSAlternativeFontEncoding#getCharacterEncodingMap()
   */
  @Override
  public Map<Character, Character> getCharacterEncodingMap() {
    return altFontEncoding2;
  }
}
